<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>编辑盘点批号</title>
    <link rel="stylesheet" href="__PEAR__/component/pear/css/pear.css" />
</head>
<body>
<form class="layui-form" action="">
    <div class="mainBox">
        <div class="main-container">
            <div class="main-container">
            
                  <div class="layui-form-item">
				    <label class="layui-form-label">盘点仓库</label>
				    <div class="layui-input-inline">
				     	<select name="branch_no" lay-filter="branch_no" lay-verify="" lay-search>
									<option value="">请选择...</option>
									{volist name="wareHouse" id="vo"}
									<option value="{$vo['branch_no']}">{$vo['branch_name']}</option>
									{/volist}
						</select>
				    </div>
				  </div>
				  
				  <div class="layui-form-item">
				    <label class="layui-form-label">盘点范围</label>
				    <div class="layui-input-inline">
	      				<select lay-filter="oper_range" name="oper_range">
					 			<option value="-1">--请选择--</option>
                                 <option value="0">全场盘点</option>
                                 <option value="1">单品盘点</option>
                                 <option value="2">类别盘点</option>
                                 <option value="3">品牌盘点</option>
                        </select>
				    </div>
				  </div>
				  
				  <div class="layui-form-item">
				    <label class="layui-form-label">备注</label>
				    <div class="layui-input-inline">
				     	<input type="text" name="memo" id="memo" placeholder="" class="layui-input">
				    </div>
				  </div>
				  
        		<input name="sheet_no" type="hidden" value="{$one['sheet_no']}"/>
            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="pdno-save">
                <i class="layui-icon layui-icon-ok"></i>
                提交
            </button>
            <button type="reset" class="pear-btn pear-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>
<script src="__STATIC__/lib/layui/layui.js"></script>
<script src="__PEAR__/component/pear/pear.js"></script>
<script>
layui.use(['form','jquery'],function(){
    let form = layui.form;
    let $ = layui.jquery;
    var path="/{$MODULE_NAME}/check/pdsheet";
	var _url="/createSheetno";


	//仓库事件
	form.on('select(branch_no)', function(data){
		branch_no=data.value;
	}); 
	
	//盘点范围
	form.on('select(oper_range)', function(data){
		oper_range=data.value;
	}); 
	
  	
    form.on('submit(pdno-save)', function(data){

        $.ajax({
            url:path+_url,
            data:JSON.stringify(data.field),
            dataType:'json',
            contentType:'application/json',
            type:'post',
            success:function(result){
                if(result.code){
                    layer.msg(result.msg,{icon:1,time:1000},function(){
                        parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
                        parent.layui.table.reload("pdsheet-table");
                    });
                }else{
                    layer.msg(result.msg,{icon:2,time:1000});
                }
            }
        })
        return false;
    });
})
</script>
<script>
</script>
</body>
</html>